package controllers;

import models.deadbolt.RoleHolder;
import play.mvc.Controller;
import controllers.deadbolt.DeadboltHandler;
import controllers.deadbolt.ExternalizedRestrictionsAccessor;
import controllers.deadbolt.RestrictedResourcesHandler;
import controllers.securesocial.SecureSocial;

public class ADietaDeadboltHandler extends Controller implements DeadboltHandler {

	public void beforeRoleCheck() {
		try {
			SecureSocial.DeadboltHelper.beforeRoleCheck();
		} catch (Throwable throwable) {
			throwable.printStackTrace();
			throw new RuntimeException(throwable);
		}
	}

	public RoleHolder getRoleHolder() {
		return CustomCRUD.getUsuarioLogueado();
	}

	@Override
	public void onAccessFailure(String controllerClassName) {
		forbidden();
	}

	@Override
	public ExternalizedRestrictionsAccessor getExternalizedRestrictionsAccessor() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public RestrictedResourcesHandler getRestrictedResourcesHandler() {
		// TODO Auto-generated method stub
		return null;
	}

}
